Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

leajs-locale

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

leajs-locale

simplifies handling locale header

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

leajs-locale

Plugin of leajs.

Simplifies handling locale header.

leajs.config

module.exports = {

  // …

  // Locale options, can be used as a shortcut for 'locale.available'
  locale: null, // [Object, Array]

  // Available languages, first languages is fallback
  locale.available: null, // Array

  // Query property to overwrite browser language
  locale.query: null, // String

  // Position in url to look for used language
  locale.url: null, // Number

  // …

}

Example

module.exports = {

  // …

  locale: {
    available: ["en","de"],
    query: "lang", // will allow ?lang=en
    url: "1" // will parse /de/someurl
  }
  
  // …

}

License

Copyright (c) 2018 Paul Pflugradt Licensed under the MIT license.

FAQs

Package last updated on 29 May 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc